<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>购物车</title>
    <!-- <link rel="stylesheet" href="css/reset.css"> -->
    <link rel="stylesheet" href="css/cart.css">
</head>
<body>
	<jsp:include page="common/header.jsp"></jsp:include>
	<form id="frmorder" action="/orders/addOrder" method="post">
	<input type="hidden" name="userid" value="${user.userid }"/>
    <section class="cartMain">
        <div class="cartMain_hd">
            <ul class="order_lists cartTop">
                <li class="list_chk">
                    <!--所有商品全选-->
                    <input type="checkbox" id="all" class="whole_check">
                    <label for="all"></label>
                    全选
                </li>
                <li class="list_con">商品信息</li>
                <li class="list_info">商品参数</li>
                <li class="list_price">单价</li>
                <li class="list_amount">数量</li>
                <li class="list_sum">金额</li>
                <li class="list_op">操作</li>
            </ul>
        </div>

        <div class="cartBox">
            <div class="order_content">
            	<c:if test="${!empty carts }">
            	<c:forEach items="${carts}" var="cart">
                <ul class="order_lists">
                    <li class="list_chk">
                        <input type="checkbox" id="checkbox_2" name="cartids" value="${cart.cartid }" class="son_check">
                        <label for="checkbox_2"></label>
                    </li>
                    <li class="list_con">
                        <div class="list_img"><a href="javascript:;"><img style="width:90px;height:100px;" src="${cart.goodsthums}" alt=""></a></div>
                        <div class="list_text"><a href="javascript:;">${cart.goodsnames}</a></div>
                    </li>
                    <li class="list_info">
                        <p>规格：默认</p>
                        <p>尺寸：${cart.skuattrvalue }</p>
                    </li>
                    <li class="list_price">
                        <p class="price">￥${cart.goodsprice}</p>
                    </li>
                    <li class="list_amount">
                    	<input class="cartid" name="cartid" type="hidden" value="${cart.cartid }"/>
                    	<input class="goodsprice" name="goodsprice" type="hidden" value="${cart.goodsprice }"/>
                        <div class="amount_box">
                            <a href="javascript:;" class="reduce reSty">-</a>
                            <input type="text" id="num" value="${cart.goodscount }" class="sum">
                            <a href="javascript:;" class="plus">+</a>
                        </div>
                    </li>
                    <li class="list_sum">
                        <p class="sum_price">￥${cart.goodstotalprice}</p>
                    </li>
                    <li class="list_op">
                        <p class="del"><a href="javascript:;" class="delBtn">移除商品</a></p>
                    </li>
                </ul>
                </c:forEach>
                </c:if>
                <c:if test="${empty carts}">
                	<div style="text-align:center;margin:13% 0px;"><font style="font-size:30px;">您还没有添加商品到购物车！</font></div>
                </c:if>
            </div>
        </div>
        <!--底部-->
        <div class="bar-wrapper">
            <div class="bar-right">
            	<input type="hidden" name="goodcount" value="0"/>
            	<input type="hidden" name="totalprice" value="0"/>
                <div class="piece">已选商品<strong class="piece_num">0</strong>件</div>
                <input type="hidden" name="sum" value="0"/>
                <div class="totalMoney">共计: <strong class="total_text">0.00</strong></div>
                <div class="calBtn"><a href="javascript:;">结算</a></div>
            </div>
        </div>
    </section>
    <section class="model_bg"></section>
    <section class="my_model">
        <p class="title">删除宝贝<span class="closeModel">X</span></p>
        <p>您确认要删除该宝贝吗？</p>
        <div class="opBtn"><a href="javascript:;" class="dialog-sure">确定</a><a href="javascript:;" class="dialog-close">关闭</a></div>
    </section>
    </form>
    <script src="js/jquery.min.js"></script>
    <script src="js/cart.js"></script>
	<jsp:include page="common/footer.jsp"></jsp:include>
</body>
</html>